package cn.fuxi2022.rabbitmq.appletsPay.properties;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class WeChatMQProperties implements InitializingBean {

    @Value("${smartGroup.outTime}")
    public String outTime;

    @Value("${smartGroup.alertTime}")
    public String alertTime;

    /**
     * 订单超时时间（毫秒）
     */
    public static Integer GROUP_ORDER_TTL_ORDER_QUEUE_TIME;

    /**
     * 订单提醒时间（毫秒）
     */
    public static Integer GROUP_ORDER_TTL_ORDER_ALERT_TIME;

    @Override
    public void afterPropertiesSet() {
        GROUP_ORDER_TTL_ORDER_QUEUE_TIME = Integer.parseInt(outTime) * 60 * 1000;
        GROUP_ORDER_TTL_ORDER_ALERT_TIME = Integer.parseInt(alertTime) * 60 * 1000;
    }
}
